function [coeff,se] = beta_hac(y,x)

% coeff is cov(y,x)/var(x) = corr(y,x)*std(y)/std(x)
% se is the standard error
% x needs to be one vector

n = size(y,2);
se = zeros(n,1);
for i = 1:n
    [~,se_temp] = hac(x,y(:,i),'Display','off');
    se(i) = se_temp(2);
end
coeff = corr(y,x)'.*std(y)/std(x);

end

